﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;
using System.Xml.XPath;

namespace Obfuscator
{
    public partial class XMLFileView : Form
    {
        public XMLFileView()
        {
            InitializeComponent();
            if (MainForm.AssembliesPaths.Count != 0)
            {
                foreach (var assembliesPath in MainForm.AssembliesPaths)
                {
                     AssembliesPathsComboBox.Items.Add(assembliesPath);

                }
                AssembliesPathsComboBox.SelectedIndex = 0;
            }

        }

        private void CloseViewXMLBtn_Click(object sender, EventArgs e)
        {
            Close();
        }


        private void SelectIndexComboBox(object sender, EventArgs e)
        {
            string document = (sender as ComboBox).SelectedItem.ToString() ;
            var doc = XDocument.Load(ObfuscatorSettings.OUTPUT_PATH + @"\Mapping." + document.Replace(".exe", "") + ".xml");
            XmlTBx.Text = doc.ToString();
        }

    }
}
